home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga News 96
/
Amiga News 96.iso
/
dpat
/
dpat129
/
amighpv2a
/
docs
/
amighp2.0a_eng.doc
next >
Wrap
Text File
|
1977-12-31
|
8KB
|
438 lines
********************
* AMIGHP V1.0 *
* © LEGER Frederic *
********************
* *
* MANUAL *
* *
********************
1) The compilation
-----------------
run a shell with the following sentence :
AMIGHP infile outfile
Easy, isn't it ?
2) The compiler stack
---------------------
AMIGHP use a twice level stack, which are in the register
A.A and C.A.
To save this stack you must use the STO instruction.
ex:
12 I ADD -> C.A
15 I ADD -> A.A
ADD -> C.A = C.A + A.A
I STO -> I = C.A , C.A is now empty
If you use the stack, you can improve the optimisation of your
output-code.
You can for exemple write : 0 I STO I 15 ADD 12 MUL I STO
I will have a value of 180.
WARNING : The stack has only a 2 levels height, not 3 or more !
The compiler will explain you this problem.
3) The variables
----------------
The temporary storage of those variables is at $800F5h.
So this methode permits having 266.5 good bytes, without any
address computation. ( Let's having SPEEEEED!)
Remember : CHARS are INTEGERS in AMIGHPv1.
4) The instructions
-------------------
DEF ...... ENDDEF
-----------------
Variables are defined in a block surrounded by DEF and FINDEF
This block is always on the top of your programs.
you MUST write it even if it is empty.
INTEGER
-------
At present time, only integer type is available for variables.
You can use 106 integers at maximum.
An integer has a value between [0,1048575].
An integer is a variable which can be in the A field of C or
any other register.
ex:
DEF
I J K INTEGER
FINDEF
CHAR and POINTER
----------------
You can define CHAR variables or POINTER but they are in fact INTEGERS.
INC
---
Variable ++
ex:
I INC
DEC
---
Variable --
ex:
I DEC
STO
---
Stocke a value , a result or a variable in a variable.
ex:
120 I STO ou J I STO (stocke dans I)
EXIT
----
Should I explain you ?
ex:
.... I PUSH EXIT
PUSH
----
Push a variable in the HP48 stack.
ex:
I PUSH
ADD
---
Addition of two operands , results in C.A or A.A
ex:
I J ADD K STO
I 10 ADD K STO
SUB
---
Subtraction of two operands , results in C.A or A.A
ex:
I J SUB K STO
I 10 SUB K STO
MUL
---
Multiplication of 2 operands , results in C.A or A.A
ex:
I J MUL K STO
I 10 MUL K STO
INTOFF
------
Remove the interruptions.
INTON
-----
interruptions are BACK !
POP
---
Read a system binary in the HP48 stack and put it in a variable.
This fonction DROP the SB.
ex: --------------
I POP |4) |
=> I = 154A4h |3) |
|2) |
|1) <154A4h> |
|--------------|
| | | | | |
--------------
LOOP
--
Open a LOOP...ENDLOOP
ENDLOOP
----
Close a LOOP...ENDLOOP
WHILE
-----
WHILE condition DO instructions ENDWHILE
ex:
WHILE
I J <
DO
I DEC
ENDWHILE
==,!=,<,>,<=,>=
---------------
Compare two operands
I J <= is read I <= J
I 10 <= is read I <= 10
IF
--
ex:
IF IF
I 50 > I 50 >
THEN THEN
I DEC I DEC
ELSE ENDIF
I INC
ENDIF
The ENDIF is always NECESSARY, not IF.
INCLUDE
-------
You can use ASM "inline" with this instruction.
ex:
ROUT1.ASM INCLUDE
GETI
----
Get one integer witch is pointed by D1.
(Get the address of the first object in the HP48 stack
and put it in a variable.)
ex:
ADR.OBJ GETADR
PUTI
----
Write an integer with help of D1.
D1STO
-----
Put a variable or a number into D1.
ex:
526032 I STO I D1STO -> BEURK !!!
526032 D1STO -> D1=(5) $806D0
D1RCL
-----
Save D1 in a variable.
ex:
15400 I STO I D1STO J PUTC I D1RCL
GETC
----
Get a char pointed by D1 in a variable.
and make D1=D1+2.
ex:
15400 I STO I D1STO J GETC
PUTC
----
Put a char at the address pointed by D1.
and make D1=D1+2.
ex:
15400 I STO I D1STO J PUTC
GETCAR
------
Get a char pointed by D1 in a variable.
ex:
15400 I STO I D1STO J GETCAR
PUTCAR
------
Put a char at the address pointed by D1.
ex:
15400 I STO I D1STO J PUTCAR
DROP
----
Drop the first level of the HP48 stack.
RESSTR
-------
Reserve a string in memory and give a pointer on the content.
IMPORTANT: the twice level of the compiler stack are saved before
and restored ... after, yes!
ex:
1500 TAILLE.MEM STO
ADR.BEG SIZE RESSTR
WARNING: The address of the content is the address of beginning
+ 10 bytes.
STRCALC
--------
Compute a string.
IMPORTANT: the twice level of the compiler stack are saved before
and restored after.
ex:
ADR.FIN ADR.BEG PUSH_STR
PUSHOBJ
--------
Push one object into the HP48 stack.
ex:
ADR.DEB PUSH_OBJ
DISPON
------
Display ON.
DISPOFF
-------
Display OFF.
AON
---
Indicators ON.
AOFF
----
Indicators OFF.
BEEP
----
Oh Oh Oh Pump up the volume !
IMPORTANT: the twice level of the compiler stack are saved before
and restored after.
ex:
DURATION FREQUENCY BEEP
DURATION is in milliseconds .
SL
--
multiplicate by 2.
ex:
I SL
SR
--
divide by 2.
ex:
J SR
INCD1
-----
ex:
12 INCD1 -> D1=D1+ 12
ERROR
-----
Make an error message and quit.
ex:
5 ERROR -> "Error: Memory Clear"
GOSUB
-----
Jump to a procedure.
ex:
BOB GOSUB
RETURN
------
Come back from a procedure.
ex:
IF I 560 == THEN RETURN ELSE EXIT ENDIF
NOT
---
AND
---
OR
--
7) THE PROCEDURES
-----------------
You can show how to declare a procedure in this example:
<<
DEF Declaration of global variables.
FINDEF
DO
BOB GOSUB -> GOSUBL BOB
EXIT D0=D0+ 5
LOOP A=DAT0 A ...
BOB PROC *
DEF | Declaration of local variables.
FINDEF | (not really local)
|
ENDPROC * -> RTN
>>
6) APPENDICES
-------------
- AMIGHP has got some (a lot of ?) bugs AAAARGH!
But the parts of programs I give with, deals we can work with it.
In my opinion, AMIGHP is a good way to learn assembleur.
I hope you will enjoy this progs, even if you do not use it,(like me).
Please, excuse me for my english, because it isn't my native langage.
- The software is totally free in the usage.
BUT REMEMBER THAT YOU USE IT AT YOUR OWN RISK !!!
- header for HPASMv3.10e By Vallee Christophe
beginning : include entries.i
con(5) DOCODE
Start con(5) End-Start
......................
......................
end : End
- The Futur :
-----------
+ Some new base-address for the variables.
+ A type LONG (64bits).
+ A new PUSHOBJ.
+ Many others fonctions.
+ A GUI with Requesters.
+ MAC and PC Versions.
7) ABOUT
--------
Name: LEGER
FirstName: Frederic
NickName: LEDJ
Age : 19
Level: DEUG TI
University: Grenoble FRANCE
My AMIGA : un A500+,A530,4Mb 60ns,2Mb CHIP,
1 Giga AMI ,1 Giga PC and 58Mb MAC.
To contact me : MINITEL 3614 BAL NANARD125
A special thank you to my friends Vincent ROUKINE (ROOK)
and Vincent VERILHAC (VV Fly is here?) for their helpfull
pieces of advices !!!
___
\\\\
\\\\
\\\\ ONLY AMIGA !!!
\\\\ ___
\\\\ ////
\\\\ ////
\\\\////
\\\/// LEDJ
\\//
\/
*** DISCLAIMER ***
NO GUARANTEE IS GIVEN NOR IMPLIED THAT THIS PROGRAM IS FIT FOR ANY
USE. THIS PROGRAM AND THE INFORMATION WITHIN THIS TEXT IS PROVIDED ON
"AS IS" BASIS. THE ENTIRE RISK AS TO ITS QUALITY AND PERFORMANCE IS
WITH THE USER. SHOULD THE PROGRAM PROVE DEFECTIVE, THE USER (AND NOT
THE AUTHOR) ASSUMES THE ENTIRE COST OF ALL NECCESSARY DAMAGES. IN NO
EVENT WILL THE AUTHOR BE LIABLE FOR DIRECT, INDIRECT, INCIDENTAL OR
CONSEQUENTIAL DAMAGES RESULTING FROM ANY DEFECT IN THE PROGRAM. THE
AUTHOR RESERVES THE RIGHT TO MAKE CHANGES TO THE SOFTWARE OR
DOCUMENTATION WITHOUT NOTICE.